<?php
class Link extends AppModel{
    public $useTable  = 'link';
    public $lang_code = 'vn';
    
    
    public function get_link($slug = null, $lang_code = null)
    {
        $sql = array('conditions' => array('link =' => $slug, 'lang_code' => $lang_code), 'limit' => 1);
        $link = $this->find('all', $sql);
        if(!empty($link))
            return $link[0]['Link'];
        else
            return array();
    }
}
    